<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/base.css" />
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/info-mgt.css" />
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/WdatePicker.css" />
<title>移动办公自动化系统</title>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.js"></script>
<script type="text/javascript">
	function skipPage(currentPage){
        var url='${pageContext.request.contextPath }/RecordManager.action?method=query&currPage='+currentPage;
        window.location.href=url;
    }
    
    function del(id){
    	var currPage=${requestScope.Recordpage.currentPage};
      	 
      	 	if(window.confirm("确定删除?")){
      	 		var url="RecordManager.action?method=delete&id="+id+"&currPage="+currPage;
      	 		window.location.href=url;
      	 	}
    }
    function search(){
    	var Recordname=$(":text").val();
		url="${pageContext.request.contextPath }/RecordManager.action?method=query&username="+Recordname,
		window.location.href=url;
    }
</script>
</head>

<body>
<div class="title"><h2>人事变动信息</h2></div>
<div class="query">
	<div class="query-conditions ue-clear">
        <div class="conditions staff ue-clear">
            <label>人&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;员：</label>
            <input type="text" placeholder="请输入要查找的人员名称" />
        </div>
    </div>
    <div class="query-btn ue-clear">
    	<a href="javascript:search();" class="confirm">查询</a>
    </div>
</div>

<div class="table-operate ue-clear">
	<a href="RecordManager.action?method=now" class="add">新增</a>
</div>

	<table>
    	<thead>
        	<tr>
            	<th class="num">编号</th>
                <th class="name">员工姓名</th>
                <th class="process">原属部门</th>
                <th class="node">现属部门</th>
                <th class="node">原任职位</th>
                <th class="node">现任职位</th>
                <th class="node">操作日期</th>
                <th class="operate">操作</th>
            </tr>
        </thead>
        <tbody>
        <c:forEach items="${requestScope.Recordpage.recordView}" var="view" varStatus="c">
        	<tr>
            	<td class="num">${view.recordid }</td>
                <td class="name">${view.userName }</td>
                <td class="process">${view.oldDept }</td>
                <td class="node">${view.newDept}</td>
                <td class="num">${view.oldJob }</td>
                <td class="name">${view.newJob }</td>
                <td class="name">${view.operateDate }</td>
                <td class="operate"><a href="javascript:;" onclick="del('${view.recordid }');">删除</a></td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
	<table>
			<tr>
				<td>
					<a onclick="skipPage('1');">首页</a>
				</td>
				<td>
					<a
						onclick="skipPage('${requestScope.Recordpage.currentPage==1?1:requestScope.Recordpage.currentPage-1 }');">上一页</a>
				</td>
				<td>
					<a
						onclick="skipPage('${requestScope.Recordpage.currentPage==requestScope.Recordpage.totalPage?(requestScope.Recordpage.currentPage):(requestScope.Recordpage.currentPage+1) }');">下一页</a>
				</td>
				<td>
					<a onclick="skipPage('${requestScope.Recordpage.totalPage}');">末页</a>
				</td>
				<td>
					当前页码：${requestScope.Recordpage.currentPage
					}/${requestScope.Recordpage.totalPage}
				</td>
			</tr>
		</table>
</body>
</html>
